import { post } from '@/api/http';
import { defineStore } from 'pinia'

export const useBrandInfoStore = defineStore('brandInfo', {
    state: () => {
        return {
            total: 10,
            page: 1,
            size: 10,
            table: {
                dataList: []
            } as any,
            selectedRowKeys: [] as any,
            rowKey: 'id',
            tableColumns: [
                {
                    title: "序号",
                    key: "brandCode",
                    dataIndex: "brandCode",
                    width: 150
                },

                {
                    title: "品牌名称",
                    key: "brandName",
                    dataIndex: "brandName",
                    width: 150
                },
                {
                    title: "布类类型",
                    key: "clothClass",
                    dataIndex: "clothClass",
                    width: 150
                },
                {
                    title: "备注",
                    key: "remark",
                    dataIndex: "remark",
                    width: 150
                },
                {
                    title: "创建人",
                    key: "createName",
                    dataIndex: "createName",
                    width: 150
                },
                {
                    title: "创建时间",
                    key: "createTime",
                    dataIndex: "createTime",
                    width: 200
                },
                {
                    title: "最后修改人",
                    key: "updateName",
                    dataIndex: "updateName",
                    width: 150
                },
                {
                    title: "最后修改时间",
                    key: "updateTime",
                    dataIndex: "updateTime",
                    width: 200
                },
                // {
                //     title: "删除状态",
                //     key: "deleteState",
                //     dataIndex: "deleteState",
                //     width: 100,
                //     slotName: "deleteState",
                //     fixed: 'right'
                // },
                {
                    title: '操作',
                    key: "id",
                    slotName: 'act',
                    width: 150, fixed: 'right'
                }
            ] as any,
            pageData: {
                nameList: [],
                showAdd: false,
                sideTitle: '新增品牌资料',
                dropDownData: "",
                pageLoading: false,
                typeList: [],
                dropDownData1: "",
                rHeight: 0,
                btnList: [],
                isEdit: false
            } as any,
        };
    },
    actions: {
        selectBd() {
            return post({
                url: "product/Brand/getPage",
                data: {
                    page: this.page,
                    size: this.size,
                    deleteState: 0,
                    brandName: this.pageData.dropDownData
                }
            })
        },
    },
})